<template>
  <div class="left">
    <el-tabs :tab-position="tabPosition">
      <el-tab-pane
        v-for="(item, index) in categoryRelationList"
        :key="index"
        :label="item.name"
      >
        <div v-for="(item, index) in item.goods" @click="goDetail()" :key="index" class="cs">
         
            <img v-bind:src="API.BASE_SERVER_URL + item.imgPath" class="img" />
            <h5>{{ item.name }}</h5>
            <h4 class="h4">￥{{ item.price }}.00</h4>
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
export default {
  data() {
    return {
      categoryRelationList: [],
      tabPosition: "left",
    };
  },
  methods: {
    goDetail(){
      this.$router.push({path:'detail'})
    }
  },
  
  created: function () {
    this.$get(this.API.BASE_SERVER_URL + "/api/v1/getCateGoryList").then(
      (res) => {
        if (res.errorCode == 0) {
          this.categoryRelationList = res.data;
        }
      }
    );
  },
};
</script>

<style  scoped>
.left {
  margin-top: 60px;
}
.img {
  width: 100px;
  height: 100px;
}

.cs {
  width: 105px;
  height: 160px;
  float: left;
  margin-left: 2px;
  font-size: 5px;
  font-family: Arial, Helvetica, sans-serif;
}
.h4 {
  color: coral;
  font-size: 15px;
}
</style>